<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of ToolsBar
 *
 * @author Administrator
 */
class ToolsBar {

    public static function add($url="", $title="") {
        return CHtml::link(CHtml::image(Yii::app()->request->baseUrl . "/public/admin/ico_handle_add.gif", $title), $url, array('class' => 'toolsbar'));
    }

    public static function del($url="", $title="") {
        if (empty($title)) {
            $title = Yii::t('default', '删除这条记录');
        }
        return CHtml::link(CHtml::image(Yii::app()->request->baseUrl . "/public/admin/ico_handle_del.gif", $title), $url, array('class' => 'toolsbar', 'title' => $title, 'onclick' => 'return confirm(\'确认删除吗?\')'));
    }

    public static function edit($url="", $title="") {
        if (empty($title)) {
            $title = Yii::t('default', '修改这条记录');
        }
        return CHtml::link(CHtml::image(Yii::app()->request->baseUrl . "/public/admin/ico_handle_edit.gif", $title), $url, array('class' => 'toolsbar', 'title' => $title));
    }

    public static function move($url="", $title="") {
        return CHtml::link(CHtml::image(Yii::app()->request->baseUrl . "/public/admin/ico_handle_move.gif", $title), $url, array('class' => 'toolsbar'));
    }

    public static function back($url="") {
        return CHtml::button(Yii::t('default', '返 回'), array('onclick'=>'location.href="'.$url.'"', 'class'=>'btn'));
    }
    public static function submit(){
        return CHtml::submitButton(Yii::t('default', '提 交'), array('class' => 'btn'));
    }
    public static function save(){
        return CHtml::submitButton(Yii::t('default', '保 存'), array('class' => 'btn'));
    }
    public static function next($name){
        return CHtml::submitButton(Yii::t('default', '下一步'), array('class' => 'btn', 'name' => $name));
    }    public static function make(){
        return CHtml::button(Yii::t('default', '生 成'), array('class' => 'btns', 'id' => "make"));
    }
}
